import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("Jacky")),
      body: const Column(
        children: [MyApp(), MyButton(), MyText()],
      ),
    ),
  ));
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Center(
      child: Container(
        alignment: Alignment.center,
        width: 200,
        height: 100,
        margin: EdgeInsets.fromLTRB(0, 60, 0, 0),
        // transform: Matrix4.translationValues(40, 0, 0),
        // transform: Matrix4.rotationZ(0.2),
        // transform: Matrix4.skewY(1),
        decoration: BoxDecoration(
          color: Colors.red,
          border: Border.all(color: Colors.green, width: 4),
          borderRadius: BorderRadius.circular(10),
          boxShadow: const [
            BoxShadow(
              color: Colors.blue,
              offset: Offset(2.0, 2.0),
              blurRadius: 10.0,
            ),
          ],
          // LinearGradient,RadialGradient
          gradient: const LinearGradient(colors: [Colors.red, Colors.orange]),
        ),
        child: const Text("flutter app",
            style: TextStyle(
                color: Colors.white,
                fontSize: 20,
                fontWeight: FontWeight.bold)),
      ),
    );
  }
}

class MyButton extends StatelessWidget {
  const MyButton({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      width: 200,
      // height: 40,
      margin: const EdgeInsets.fromLTRB(0, 10, 0, 0),
      padding: const EdgeInsets.all(10),
      decoration: BoxDecoration(
        color: Colors.blue,
        borderRadius: BorderRadius.circular(10),
      ),
      child: const Text(
        "按钮",
        style: TextStyle(color: Colors.white, fontSize: 16),
      ),
    );
  }
}

class MyText extends StatelessWidget {
  const MyText({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 200,
      margin: const EdgeInsets.fromLTRB(0, 20, 0, 0),
      decoration: BoxDecoration(color: Colors.red),
      child: const Text(
        '我叫jacky我叫jacky我叫jacky我叫jacky我叫jacky我叫jacky我叫jacky我叫jacky',
        textAlign: TextAlign.left,
        maxLines: 2,
        overflow: TextOverflow.ellipsis,
        style: TextStyle(fontSize: 16, decoration: TextDecoration.underline, letterSpacing: 2, decorationColor: Colors.amber),
      ),
    );
  }
}
